function [sort_id,sort_result] = match_examplar(exampler_set, feat, way)

num     = size(exampler_set,2);
feat    = repmat(feat(:), 1, num);
%feat             =   repmat(feat(:),1, size(exampler_set,2));
if way == 1

    %match_result     =   sum(feat&exampler_set,1)./(sum(feat(:,1)) +
    %part_shape{partID}.fsum) ;   % sum(feat&exampler_set,1);  
    res     =   sum(feat&exampler_set,1)./(sum(feat|exampler_set,1)); 
    %[best_socre best_match] = max(match_result); 

elseif way == 2
    m     =   zeros(size(feat));
    m(exampler_set) =   feat(exampler_set);
    res     =   sum(m, 1);
    res     =   res./sum(exampler_set,1);
elseif way == 3
    m       =   zeros(size(feat));    
    m2      =   m;
    m(exampler_set)    =   feat(exampler_set); 
    m2(~exampler_set)  =   1-feat(~exampler_set);
    res     =   sum(m, 1) +  sum(m2, 1);
    
    %- feat(~exampler_set);
    %res     =   sum(m, 1);    
elseif way == 4
    exampler_set = logical(exampler_set);
    res     =   zeros(size(exampler_set));
    res(exampler_set) = feat(exampler_set);
    res     =   -sum(res,1)./sum(exampler_set,1);
    
end


    [sort_result,sort_id]   = sort(res,'descend');               
    %res     =   sort_id;